﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace ScheduleMVVM.Model.Miscellaneous
{
    public static class BindHelper
    {
        private static List<BindItem> bindings = new List<BindItem>();
        public static void Bind(Object first, Object second)
        {
            var newBind = new BindItem()
            {
                o1 = first,
                o2 = second
            };
            bindings.Add(newBind);
        }
        public static Object Bound(Object obj)
        {
            foreach (var i in bindings)
            {
                if (i.o1 == obj) return i.o2;
                if (i.o2 == obj) return i.o1;
            }
            return null;
        }
    }
    internal struct BindItem
    {
        public Object o1,o2;
    }
}
